# encoding: utf-8
# Author    : limusen
# Datetime  : 2023/10/19 15:18
# File      : liz.py
# explain   : 文件说明
import time

from selenium import webdriver
from PIL import Image
import os
from common.config import local_config

# 启动浏览器驱动程序
from selenium.webdriver.common.by import By

path = os.path.join(
    os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)), local_config.driver_path, 'chromedriver')

driver = webdriver.Chrome(executable_path=path)
driver.maximize_window()
driver.execute_script('document.body.style.zoom="0.8"')
time.sleep(2)
# 打开网页
driver.get('https://shop.aircheng.com/simple/reg')

# 定位要截图的元素
code = driver.find_element(By.XPATH, '//*[@id="captchaImg"]')
code.screenshot('./截图1.png')

time.sleep(5)

